<?
include 'config/config.inc.php';
rinnovaSessione();
switch($_POST['op']) {
	case "province":
		$rs = lancia_procedura("elenco_province", "");
		die('{'.Get_json("rows", $rs, Array("sigla","provincia","regione")).'}');
		break;
		
	case "nazioni":
		$rs = lancia_procedura("elenco_nazioni", "");
		die('{'.Get_json("rows", $rs, Array("id","valore")).'}');
		break;
		
	case "zone":
		$_POST = decodeUtf8Array($_POST);
		$rs = lancia_procedura("elenco_zona", "'".$_POST['provincia']."','%".$_POST['citta']."%'");
		die('{'.Get_json("rows", $rs, Array("idzona","citta","provincia","provincia_txt","nome")).'}');
		break;
		
	case "pdv":
		$rs = lancia_procedura("elenco_punti_vendita", "");
		die('{'.Get_json("rows", $rs, Array("id","codice","nome","indirizzo","citta","provincia","nazione","num_volantini","num_carte")).'}');
	break;
	
	case "distributori":
		$rs = lancia_procedura("elenco_distributori", "");
		die('{'.Get_json("rows", $rs, Array("id","referente","nome","indirizzo","citta","provincia","nazione","telefono","mail","username")).'}');
	break;
	
	case "smart":
		$rs = lancia_procedura("elenco_totale_smart", "");
		die('{'.Get_json("rows", $rs, Array("idsmart","codice","modello","sim")).'}');
	break;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--<!DOCTYPE html>-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;">
<title>Check Flayer Module</title>
<link href="stili/stili.css" rel="stylesheet" type="text/css" />
<link href="stili/jquery-ui.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" media="screen" type="text/css" href="js/jpicker/jPicker.css" />
<link rel="stylesheet" media="screen" type="text/css" href="js/jpicker/css/jPicker-1.1.6.min.css" />
<!--<link rel="stylesheet" href="js/upload/jquery.fileupload-ui.css">-->
<!--<link rel="stylesheet" href="js/upload/jquery.image-gallery.css">-->
<? include 'includes/js.php';?>
</head>
<body>
<div class="viewport">
<div class="mask">
<div class="loading"><img src="images/ajax-loader.gif" align="absmiddle" /> Loading...</div>
</div>
<div class="view-top">
<? include 'includes/top.php';?>
</div>
<div id="viewleft" class="view-left">
<? include 'includes/left.php';?>
</div>
<div id="navbar" class="navbar">
<span style="font-size: .9em;">Ti trovi in:</span> <span id="cont-navbar">Home</span>
</div>
<div id="content" class="view">
</div>
<div class="view-bottom"></div>
</div>
</body>
</html>